fixed output of array and byte array literals
This commit is contained in:
		| @ -84,6 +84,7 @@ class HttpSocket(SyncSocket) | ||||
| { | ||||
| 	var(#get) server := nil. | ||||
| 	var(#get) rid := -1. | ||||
| 	var bs. | ||||
|  | ||||
| 	method close | ||||
| 	{ | ||||
| @ -104,7 +105,6 @@ class HttpSocket(SyncSocket) | ||||
|  | ||||
| 	method getLine | ||||
| 	{ | ||||
| 		 | ||||
| 	} | ||||
|  | ||||
| 	method readRequest | ||||
| @ -114,7 +114,7 @@ class HttpSocket(SyncSocket) | ||||
|  | ||||
| 	method _run_service | ||||
| 	{ | ||||
| 		| buf | | ||||
| 		| buf k i | | ||||
|  | ||||
| 		self timeout: 10. | ||||
| 		(*while (true) | ||||
| @ -123,18 +123,32 @@ class HttpSocket(SyncSocket) | ||||
|  | ||||
| 		}. *) | ||||
|  | ||||
|  | ||||
| 		buf := ByteArray new: 128. | ||||
| 'IM RUNNING SERVICE...............' dump. | ||||
| 	 | ||||
| 		(* | ||||
| 		self readBytes: buf. | ||||
| 		buf dump. | ||||
| 		self readBytes: buf. | ||||
| 		buf dump. | ||||
| 		*) | ||||
|  | ||||
| 		i := 0. | ||||
| 		while (i < 3) | ||||
| 		{ | ||||
| 			k := self.bs next: 3 into: buf startingAt: 4. | ||||
| 			(buf copyFrom: 4 count: k) dump. | ||||
| 			i := i + 1. | ||||
| 		}. | ||||
|  | ||||
| 		self close. | ||||
| 	} | ||||
|  | ||||
| 	method runService | ||||
| 	{ | ||||
| 		self.bs := ByteStream on: self. | ||||
|  | ||||
| 		[ self _run_service ] on: Exception do: [:ex |  | ||||
| 			self close. | ||||
| 			('EXCEPTION IN HttpSocket ' & ex messageText) dump  | ||||
|  | ||||
| @ -248,10 +248,6 @@ class ByteStream(Object) ### [ByteStreamable, ByteXXX] | ||||
| 		^v. | ||||
| 	} | ||||
|  | ||||
| 	method nextUint16 | ||||
| 	{ | ||||
| 	} | ||||
|  | ||||
| 	method next: count into: byte_array startingAt: pos | ||||
| 	{ | ||||
| 		## return the count bytes | ||||
|  | ||||
| @ -520,9 +520,14 @@ static int print_object (moo_t* moo, moo_bitmask_t mask, moo_oop_t oop, outbfmt_ | ||||
| 		else if (MOO_OBJ_GET_FLAGS_TYPE(oop) == MOO_OBJ_TYPE_BYTE) | ||||
| 		{ | ||||
| 			if (outbfmt(moo, mask, "#[") <= -1) return -1; | ||||
| 			for (i = 0; i < MOO_OBJ_GET_SIZE(oop); i++) | ||||
| 			i = 0; | ||||
| 			if (i < MOO_OBJ_GET_SIZE(oop)) | ||||
| 			{ | ||||
| 				if (outbfmt(moo, mask, " %d", ((moo_oop_byte_t)oop)->slot[i]) <= -1) return -1; | ||||
| 				if (outbfmt(moo, mask, "%d", ((moo_oop_byte_t)oop)->slot[i]) <= -1) return -1; | ||||
| 				for (++i; i < MOO_OBJ_GET_SIZE(oop); i++) | ||||
| 				{ | ||||
| 					if (outbfmt(moo, mask, " %d", ((moo_oop_byte_t)oop)->slot[i]) <= -1) return -1; | ||||
| 				} | ||||
| 			} | ||||
| 			if (outbfmt(moo, mask, "]") <= -1) return -1; | ||||
| 		} | ||||
| @ -548,10 +553,15 @@ static int print_object (moo_t* moo, moo_bitmask_t mask, moo_oop_t oop, outbfmt_ | ||||
| 		else if (c == moo->_array) | ||||
| 		{ | ||||
| 			if (outbfmt(moo, mask, "#(") <= -1) return -1; | ||||
| 			for (i = 0; i < MOO_OBJ_GET_SIZE(oop); i++) | ||||
| 			i = 0; | ||||
| 			if (i < MOO_OBJ_GET_SIZE(oop)) | ||||
| 			{ | ||||
| 				if (outbfmt(moo, mask, " ") <= -1) return -1; | ||||
| 				if (print_object(moo, mask, ((moo_oop_oop_t)oop)->slot[i], outbfmt) <= -1) return -1; | ||||
| 				for (++i; i < MOO_OBJ_GET_SIZE(oop); i++) | ||||
| 				{ | ||||
| 					if (outbfmt(moo, mask, " ") <= -1) return -1; | ||||
| 					if (print_object(moo, mask, ((moo_oop_oop_t)oop)->slot[i], outbfmt) <= -1) return -1; | ||||
| 				} | ||||
| 			} | ||||
| 			if (outbfmt(moo, mask, ")") <= -1) return -1; | ||||
| 		} | ||||
|  | ||||
		Reference in New Issue
	
	Block a user