Bug 82731 - [patch] net/libnss-mysql is unable to connect to the mysql server via tcp
Summary: [patch] net/libnss-mysql is unable to connect to the mysql server via tcp
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Clement Laforet
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-06-28 14:50 UTC by Vasil Dimov
Modified: 2005-07-30 22:49 UTC (History)
1 user (show)

See Also:


Attachments
libnss-mysql_def_timeout.diff (1.63 KB, patch)
2005-06-28 14:50 UTC, Vasil Dimov
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Vasil Dimov 2005-06-28 14:50:03 UTC
As reported in ports/82476, libnss-mysql's connecting to mysql server
fails immediately after attemp has began.

The problem is that mysql_options(MYSQL_OPT_CONNECT_TIMEOUT) is called
with last argument "3", to set the desired connect timeout to 3 seconds,
but, according to http://dev.mysql.com/doc/mysql/en/mysql-options.html
the argument should be unsigned int *, e.g. unsigned int x = 3, then &x
This causes too large timeout (something like 164514388) to be passed
as a timeout value resulting in subsequent select(2) call returning
EINVAL (22).

from select(2):
[EINVAL]           The specified time limit is invalid.  One of its com-
                   ponents is negative or too large.

Note that this prog may be able to connect in some circumstances when
connect(2) (with non-blocking socket) returns success immediately,
instead of EINPROGESS, or if the select(2) implementation does not
consider something like 164514388 (nearly 51 years! :) as a too large
timeout. *But* the 3 seconds timeout has never been working.
Comment 1 Jean-Yves Lefort freebsd_committer freebsd_triage 2005-06-29 20:53:12 UTC
Responsible Changed
From-To: freebsd-ports-bugs->clement

Over to maintainer.
Comment 2 Clement Laforet freebsd_committer freebsd_triage 2005-07-30 22:49:04 UTC
State Changed
From-To: open->closed

Committed, thanks! 
Are you willing to maintain this port?