big endian fixes

This commit is contained in:
roberto@silente
2010-09-10 06:58:12 +02:00
parent 6f726d6370
commit 4c4f92bad2
+9
View File
@@ -631,6 +631,10 @@ int uwsgi_get_dgram(int fd, struct wsgi_request *wsgi_req) {
uh = (struct uwsgi_header *) buffer;
wsgi_req->uh.modifier1 = uh->modifier1;
/* big endian ? */
#ifdef __BIG_ENDIAN__
uh->pktsize = uwsgi_swap16(uh->pktsize);
#endif
wsgi_req->uh.pktsize = uh->pktsize;
wsgi_req->uh.modifier2 = uh->modifier2;
@@ -686,6 +690,11 @@ int uwsgi_hooked_parse_dict_dgram(int fd, char *buffer, size_t len, uint8_t modi
ptrbuf = buffer + 4;
/* big endian ? */
#ifdef __BIG_ENDIAN__
uh->pktsize = uwsgi_swap16(uh->pktsize);
#endif
if (uh->pktsize > len) {
uwsgi_log("* WARNING * the uwsgi dictionary received is too big, data will be truncated\n");
bufferend = ptrbuf + len;