Coder Social home page Coder Social logo

WIN32 improvements about polipo HOT 5 CLOSED

jech avatar jech commented on September 28, 2024
WIN32 improvements

from polipo.

Comments (5)

jech avatar jech commented on September 28, 2024

diskcache: don't check for leading '/' on WIN32, else serving files from the webserver never works.

Please see #7.

dns: don't even try to parse resolv.conf on WIN32

Makes sense.

io: REUSEADDR has completely different semantics on WIN32, don't use it; for better security use SO_EXCLUSIVEADDRUSE

As far as I can tell from the doc, REUSEADDR has the same semantics as under Unix. We use it in order to bind to sockets in the CLOSE_WAIT state. So I won't apply that, unless you can make sure that Windows doesn't have problems with CLOSE_WAIT on the server side.

util: try detaching from the console

Makes sense.

xnoreq, could you please generate discrete patches for the two changes that I'm accepting, and send them to me either through a github pull request or using "git send-email"?

--jch

from polipo.

jech avatar jech commented on September 28, 2024

dns: don't even try to parse resolv.conf on WIN32

Makes sense.

Doesn't Cygwin or msys include a resolv.conf file?

from polipo.

xnoreq avatar xnoreq commented on September 28, 2024

Doesn't Cygwin or msys include a resolv.conf file?

In cygwin polipo is not compiled with WIN32 defined. Cygwin is like an emulation layer. Opening "/etc/resolv.conf" will actually open C:\Cygwin\etc\resolv.conf if cygwin is installed directly on C:.

With mingw it is compiled with WIN32 set and there is no emulation, so it is compiled like a normal, native windows application. Opening a path like "/etc" will always fail.

from polipo.

xnoreq avatar xnoreq commented on September 28, 2024

As far as I can tell from the doc, REUSEADDR has the same semantics as under Unix. We use it in order to bind to sockets in the CLOSE_WAIT state. So I won't apply that, unless you can make sure that Windows doesn't have problems with CLOSE_WAIT on the server side.

It doesn't. From my tests on WIN32 you can always bind during CLOSE_WAIT state. Setting SO_REUSEADDR will allow other applications to bind to the same address even during LISTEN state. So without the patch you can start as many polipo.exe as you want - they will all bind successfully.

In my pull request I removed the SO_EXCLUSIVEADDRUSE because it might still be desirable for multiple polipo processes to run on the same port but on different interfaces.

from polipo.

jech avatar jech commented on September 28, 2024

Fixed by #25. THanks.

from polipo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.