bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-wget] [GSOC] Bugfixes


From: Hubert Tarasiuk
Subject: Re: [Bug-wget] [GSOC] Bugfixes
Date: Fri, 27 Mar 2015 17:17:57 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0

Hello again,

I have prepared two small patches.

1) Helper function to set proper type flag in dt based on type string.
2) In the gethttp function, there is an effective loop that reads from
the socket until it receives a status code other than 10x. It is
currently implemented with a label and a goto statement. I made an
actual loop.

I believe that these patches are two small steps in the direction that
would make gethttp function shorter and easier to analyze.

Now I would like to work on eliminating the other label from gethttp
(used for http authentication). I was thinking about eventually moving
this logic to http_loop (the socket is closed in this case anyway). Ie.
on HTTP_STATUS_UNAUTHORIZED, the function would return to http_loop, and
appropriate actions would be taken in that function (ie. another call to
gethttp, with modified arguments).

Later on, the code handling each http status code could be perhaps
isolated and separated into smaller functions.

Am I moving in the right directions? Do you have any suggestions?

And BTW what do you think about initializing some pointer variables
(like `head` or `resp`) to NULL in order to simplify resources management?

W dniu 25.03.2015 o 23:16, Hubert Tarasiuk pisze:
> I see. I will give it a try and will get back to you.
> 
> Thank you for your assistance.
> 
> Hubert
> 
> W dniu 25.03.2015 o 22:49, Giuseppe Scrivano pisze:
>> Please keep bug-wget in CC as it will include more people in the
>> discussion.
>>
>> My refactoring wasn't very logical, I have just moved code outside of
>> gethttp. I would like that each of these functions would make more sense
>> and maybe be testable. Makes sense?
>>
>> Regards,
>> Giuseppe
>>
>> Il 25 marzo 2015 22:11:47 CET, Hubert Tarasiuk
>> <address@hidden> ha scritto:
>>
>>     Hi Giuseppe,
>>
>>     Yes, I can compile wget from repository.
>>
>>     I've looked at the function you mentioned. I could do some more cleanup
>>     - mainly by factoring out parts of the code into separate functions - as
>>     I saw in your commits. Would that be appropriate, or did you mean
>>     something different?
>>
>>     (Not sure if this part of conversation is relevant for entire bug-wget,
>>     so excluded it from CC. Let me know if I should keep CCing that list.)
>>
>>     Best regards,
>>     Hubert
>>
>>
>>     W dniu 25.03.2015 o 21:00, Giuseppe Scrivano pisze:
>>
>>         Hubert Tarasiuk <address@hidden> writes:
>>
>>             Hello to everyone,
>>
>>             My name is Hubert Tarasiuk and I am a CS student at the
>>             University of
>>             Warsaw, Poland (expected graduation date July 2015, B.Sc.).
>>
>>             I am working on my Google Summer of Code proposal for two of
>>             the GNU
>>             wget ideas':
>>
>>                 Speed up Wget's Download Mechanism
>>                 Improve Wget's Security
>>
>>
>>             As the deadline is approaching, I would like to start
>>             working on my
>>             patches. After checking the list on GitHub I see, that just
>>             one of the
>>             bugs appears to be good for me: 41002. Others are either
>>             closed/in
>>             progress/in discussion, or already have a patch proposed.
>>
>>             My question: is the bug I mentioned still good for me, or
>>             perhaps is
>>             someone working on it already?
>>             If latter, can you provide an alternative? Or should I browse
>>             Savannah/Coverity and pick something myself?
>>
>>
>>         I think that bug was already fixed and there is not anything
>>         left to do.
>>
>>         Were you already able to build wget from the git repository?
>>
>>         I've started working on some cleanup for the gethttp function in the
>>         http.c file, but still there is much left to do, maybe it is
>>         easier for
>>         some fresh eyes to identify better how to make it more readable,
>>         would
>>         you be interested in that?
>>
>>         Regards,
>>         Giuseppe
>>
>>
> 

Attachment: 0001-Factor-out-set_content_type-function-from-gethttp.patch
Description: Text Data

Attachment: 0002-Transform-read_header-label-and-goto-into-a-loop.patch
Description: Text Data

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]