Re: [2/2] wininet: HTTP_HttpAddRequestHeadersW should ignore 0-lengthheaders
"Paul TBBle Hampson" <Paul.Hampson(a)Pobox.com> wrote:
+ if (strlenW(lpszStart)==0) + { + /* Skip 0-length headers */ + lpszStart = lpszEnd; + bSuccess = TRUE; + continue; + }
Instead of 'if (strlenW(lpszStart)==0)' it's much simpler to do 'if (!*lpszStart)', and move the fix to HTTP_InterpretHttpHeader(). -- Dmitry.
On Sat, Apr 25, 2009 at 11:52:20AM +0900, Dmitry Timoshkov wrote:
"Paul TBBle Hampson" <Paul.Hampson(a)Pobox.com> wrote:
+ if (strlenW(lpszStart)==0) + { + /* Skip 0-length headers */ + lpszStart = lpszEnd; + bSuccess = TRUE; + continue; + }
Instead of 'if (strlenW(lpszStart)==0)' it's much simpler to do 'if (!*lpszStart)', and move the fix to HTTP_InterpretHttpHeader().
Looking at HTTP_InterpretHttpHeader, it should reject blank headers, otherwise it cannot produce sensible non-NULL results. But certainly changing it to !*lpszStart works. Or in fact (*lpszStart == '\0') for consistency with the previous such testh. I'll retest with this change, but I won't resubmit for now, in case you're going to tell me what I've missed about HTTP_InterpretHttpHeader. ^_^ -- ----------------------------------------------------------- Paul "TBBle" Hampson, B.Sc, LPI, MCSE Very-later-year Asian Studies student, ANU The Boss, Bubblesworth Pty Ltd (ABN: 51 095 284 361) Paul.Hampson(a)Pobox.com Of course Pacman didn't influence us as kids. If it did, we'd be running around in darkened rooms, popping pills and listening to repetitive music. -- Kristian Wilson, Nintendo, Inc, 1989 License: http://creativecommons.org/licenses/by/2.5/au/ -----------------------------------------------------------
participants (2)
-
Dmitry Timoshkov -
Paul TBBle Hampson