Software /
code /
prosody
Comparison
net/server.lua @ 867:21347a87e185
net.server: Check for potential nil handler on close
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Tue, 03 Mar 2009 20:12:31 +0000 |
parent | 855:57057f2cbecb |
child | 868:9e058e51ecaf |
comparison
equal
deleted
inserted
replaced
866:8958fe4b2391 | 867:21347a87e185 |
---|---|
316 end | 316 end |
317 handler.shutdown = function( pattern ) | 317 handler.shutdown = function( pattern ) |
318 return shutdown( socket, pattern ) | 318 return shutdown( socket, pattern ) |
319 end | 319 end |
320 handler.close = function( forced ) | 320 handler.close = function( forced ) |
321 if not handler then return true; end | |
321 _readlistlen = removesocket( _readlist, socket, _readlistlen ) | 322 _readlistlen = removesocket( _readlist, socket, _readlistlen ) |
322 _readtimes[ handler ] = nil | 323 _readtimes[ handler ] = nil |
323 if bufferqueuelen ~= 0 then | 324 if bufferqueuelen ~= 0 then |
324 if not ( forced or fatalerror ) then | 325 if not ( forced or fatalerror ) then |
325 handler.sendbuffer( ) | 326 handler.sendbuffer( ) |