commit f2fa579afd1ba433e97bbf9d42725700224e3f74
parent 6a07e964a64edaa17c3e6456fa5b580bfc75e213
Author: kyle <kyle@getaddrinfo.net>
Date: Fri, 16 Oct 2015 01:44:45 -0600
sl: at least try to do what the instructions say
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/sl b/sl
@@ -32,7 +32,7 @@ my $dbh = DBI->connect(
) or die $DBI::errstr;
# enable transactions, if possible
-$dbh->{AutoCommit} = 0;
+$dbh->{AutoCommit} = 1;
create_tables($dbh);
@@ -151,7 +151,7 @@ while (my ($new_sock, $bin_addr) = $sock->accept()) {
# child
my $child_dbh = $dbh->clone();
- $child_dbh->{AutoCommit} = 0;
+ $child_dbh->{AutoCommit} = 1;
$dbh->{InactiveDestroy} = 1;
undef $dbh;
@@ -210,6 +210,7 @@ while (my ($new_sock, $bin_addr) = $sock->accept()) {
# we read more bytes than we were expecting, keep going
}
+ $child_dbh->begin_work;
# call the appropriate handler
$msg_handlers[$msg_type]->($child_dbh, $new_sock, $addr, $msg);
@@ -223,7 +224,7 @@ while (my ($new_sock, $bin_addr) = $sock->accept()) {
}
}
- print "info: $addr: done with connection!\n";
+ print "info: $addr: disconnected!\n";
close($new_sock);
$child_dbh->disconnect();