nginx retornando netstring com comprimento errado?

1

Eu instalei o nginx ( nginx version: nginx/1.7.9 ) via macports no meu mac executando o último OSX.

Eu configurei um URI para usar o SCGI:

location /server {
    include /Users/ruipacheco/Projects/Assorted/nginx/conf/scgi_params;
    scgi_pass unix:/var/tmp/rpc.sock;
    #scgi_pass 127.0.0.1:9000;
}

E quando eu faço um GET em 127.0.0.1/server , consigo ver o seguinte no meu servidor SCGI:

633:CONTENT_LENGTH0REQUEST_METHODGETREQUEST_URI/serverQUERY_STRINGCONTENT_TYPEDOCUMENT_URI/serverDOCUMENT_ROOT/opt/local/htmlSCGI1SERVER_PROTOCOLHTTP/1.1REMOTE_ADDR127.0.0.1REMOTE_PORT62088SERVER_PORT80SERVER_NAMElocalhostHTTP_HOST127.0.0.1HTTP_CONNECTIONkeep-aliveHTTP_CACHE_CONTROLmax-age=0HTTP_ACCEPTtext/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8HTTP_USER_AGENTMozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/40.0.2214.115 Safari/537.36HTTP_DNT1HTTP_ACCEPT_ENCODINGgzip, deflate, sdchHTTP_ACCEPT_LANGUAGEen-US,en;q=0.8,End of file

O problema é que o comprimento da netstring (633) não corresponde à interpretação. Se eu entendi as especificações da netstrings corretamente, 633 deve ser o tamanho dos caracteres entre o primeiro : e o último , :

Any string of 8-bit bytes may be encoded as [len]":"[string]",". Here [string] is the string and [len] is a nonempty sequence of ASCII digits giving the length of [string] in decimal. The ASCII digits are <30> for 0, <31> for 1, and so on up through <39> for 9. Extra zeros at the front of [len] are prohibited: [len] begins with <30> exactly when [string] is empty.

For example, the string "hello world!" is encoded as <31 32 3a 68 65 6c 6c 6f 20 77 6f 72 6c 64 21 2c>, i.e., "12:hello world!,".

Então, estou recebendo o tamanho errado. Como isso pode ser explicado?

    
por ruipacheco 06.03.2015 / 01:10

0 respostas

Tags