william-os4y / fapws3

Fast Asynchronous Python Web Server (based on libev)
GNU General Public License v2.0
341 stars 38 forks source link

raise exception instead of exit #25

Closed lqs closed 13 years ago

lqs commented 13 years ago

When a error occurs in bind() or listen(), raise a exception instead of exit the program entirely.

lqs commented 13 years ago

changed to PyErr_Format.

lqs commented 13 years ago

this commit (4981fda) fix a bug which may cause memory corruption if the request is malformed. use this code to crash a fapws server:

import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.connect(('127.0.0.1', 22223))
sock.send('K1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabc')
sock.close()
william-os4y commented 13 years ago

committed. Thanks for your contribution