Timeline for Receive http response messages using OpenSSL in C
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 7, 2021 at 10:58 | history | edited | CommunityBot |
replaced https://tools.ietf.org/html/rfc with https://www.rfc-editor.org/rfc/rfc
|
|
May 23, 2017 at 12:32 | history | edited | URL Rewriter Bot |
replaced http://stackoverflow.com/ with https://stackoverflow.com/
|
|
Jul 27, 2016 at 18:25 | comment | added | Remy Lebeau |
That is one of several possibilities. I can't say for sure since you haven't shown the actual response. But if you read the pseudo-code I linked to, I take chunked into account during reading.
|
|
Jul 27, 2016 at 18:10 | comment | added | thanhdx |
So, as I say, I received a reponse message, which have Content-Type: text/html but the body contain non-alpha numeric character, unreadable. I think it may be caused of the field Transfer-Encoding: chunked appear in the header of message, mayn't it?
|
|
Jul 27, 2016 at 15:30 | comment | added | Remy Lebeau |
@ĐặngXuânThành use whatever logic makes sense for your app. Use a buffer you parse, or read bytes by byte, it is up to you. The socket does not care. The HTTP body transfers bytes, not text. The bytes may represent text, depending on the Content-Type . Read the RFC I linked to, it explains how HTTP works.
|
|
Jul 27, 2016 at 8:40 | comment | added | thanhdx | - By the way, I have to use OpenSSL and be asked to not use any library else. So, thanks for advice :) | |
Jul 27, 2016 at 8:40 | comment | added | thanhdx |
- As the example in my question above, it has field Content-Length: 0 and still be chunked? May it happen? I haven't check this issue yet. It will be in next edited :).
|
|
Jul 27, 2016 at 8:40 | comment | added | thanhdx |
- Does the chunked data causes the body of response message what I read in the normal way by my function be wrong? Such as have non-alpha numberic ASCII character ( while I've got Content-Type: text/html in the header ) ? I actually got this. So confused.
|
|
Jul 27, 2016 at 8:39 | comment | added | thanhdx | - How do I read a line of text until CRLF? SSL_read() reads to buffer by bytes. Should I read bytes to buffer then parse it to handle each line? Or read bytes one by one until CRLF(it maybe run so slow)? Or anything else? | |
Jul 27, 2016 at 8:11 | comment | added | thanhdx | Hi, after reading more infomation, I still have some question: | |
Jul 26, 2016 at 23:09 | comment | added | thanhdx | Thanks. I'll try and reply you soon. | |
Jul 26, 2016 at 21:57 | history | edited | Remy Lebeau | CC BY-SA 3.0 |
added 281 characters in body
|
Jul 26, 2016 at 21:44 | history | edited | Remy Lebeau | CC BY-SA 3.0 |
added 151 characters in body
|
Jul 26, 2016 at 21:30 | history | answered | Remy Lebeau | CC BY-SA 3.0 |