Skip to content

Commit

Permalink
fixed Mojo::IOLoop Windows support
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 23, 2010
1 parent f8743b4 commit c361b6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -15,6 +15,7 @@ This file documents the revision history for Perl extension Mojolicious.
than allowed.
- Fixed graceful shutdown support in Mojo::Server::Daemon::Prefork.
- Fixed a auto rendering bug related to bridges.
- Fixed Mojo::IOLoop Windows support.

0.999929 2010-08-17 00:00:00
- Removed OS X resource fork files.
Expand Down
15 changes: 11 additions & 4 deletions lib/Mojo/IOLoop.pm
Expand Up @@ -48,6 +48,9 @@ use constant TLS => $ENV{MOJO_NO_TLS} ? 0
use constant TLS_READ => TLS ? IO::Socket::SSL::SSL_WANT_READ() : 0;
use constant TLS_WRITE => TLS ? IO::Socket::SSL::SSL_WANT_WRITE() : 0;

# Windows
use constant WINDOWS => $^O eq 'MSWin32' ? 1 : 0;

# Default TLS cert (20.03.2010)
# (openssl req -new -x509 -keyout cakey.pem -out cacert.pem -nodes -days 7300)
use constant CERT => <<EOF;
Expand Down Expand Up @@ -553,11 +556,15 @@ sub write {
$c->{buffer} = Mojo::ByteStream->new unless exists $c->{buffer};
$c->{buffer}->add_chunk($chunk);

# Callback
$c->{drain} = 0 if $cb;
# UNIX only
unless (WINDOWS) {

# Fast write
$self->_write($id);
# Callback
$c->{drain} = 0 if $cb;

# Fast write
$self->_write($id);
}

# Callback
$c->{drain} = $cb if $cb;
Expand Down

0 comments on commit c361b6f

Please sign in to comment.