Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Z
zmap
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ensembl-gh-mirror
zmap
Commits
18c8f05c
Commit
18c8f05c
authored
15 years ago
by
mh17
Browse files
Options
Downloads
Patches
Plain Diff
fixed hang up error on race condition on pipe stderr
parent
ad350c46
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/zmapServer/pipe/pipeServer.c
+13
-7
13 additions, 7 deletions
src/zmapServer/pipe/pipeServer.c
src/zmapServer/pipe/pipeServer_P.h
+2
-2
2 additions, 2 deletions
src/zmapServer/pipe/pipeServer_P.h
with
15 additions
and
9 deletions
src/zmapServer/pipe/pipeServer.c
+
13
−
7
View file @
18c8f05c
...
...
@@ -34,7 +34,7 @@
* HISTORY:
* Last edited: Nov 30 09:18 2009 (edgrif)
* Created: 2009-11-26 12:02:40 (mh17)
* CVS info: $Id: pipeServer.c,v 1.
5
2009-12-0
4
1
6:01
:3
9
mh17 Exp $
* CVS info: $Id: pipeServer.c,v 1.
6
2009-12-0
7
1
0:48
:3
1
mh17 Exp $
*-------------------------------------------------------------------
*/
...
...
@@ -256,7 +256,8 @@ static gboolean pipe_server_spawn(PipeServer server,GError **error)
if
(
result
)
{
server
->
gff_pipe
=
g_io_channel_unix_new
(
pipe_fd
);
server
->
gff_error
=
g_io_channel_unix_new
(
err_fd
);
server
->
gff_stderr
=
g_io_channel_unix_new
(
err_fd
);
g_io_channel_set_flags
(
server
->
gff_stderr
,
G_IO_FLAG_NONBLOCK
,
&
pipe_error
);
}
g_free
(
argv
);
// strings allocated and freed seperately
...
...
@@ -288,12 +289,17 @@ gchar *pipe_server_get_stderr(PipeServer server)
GError
*
gff_pipe_err
=
NULL
;
gchar
*
msg
=
NULL
;
GString
*
line
;
// GIOCondition gc;
line
=
g_string_sized_new
(
2000
)
;
/* Probably not many lines will be > 2k chars. */
while
(
1
)
{
status
=
g_io_channel_read_line_string
(
server
->
gff_error
,
line
,
// this does'nt work: doesn't hang, but doesn't read the data anyway
// gc = g_io_channel_get_buffer_condition(server->gff_stderr);
// if(!(gc & G_IO_IN))
// break;
status
=
g_io_channel_read_line_string
(
server
->
gff_stderr
,
line
,
&
terminator_pos
,
&
gff_pipe_err
);
if
(
status
!=
G_IO_STATUS_NORMAL
)
break
;
...
...
@@ -804,7 +810,7 @@ static ZMapServerResponseType closeConnection(void *server_in)
server
->
gff_pipe
=
NULL
;
}
if
(
server
->
gff_er
ro
r
&&
g_io_channel_shutdown
(
server
->
gff_er
ro
r
,
FALSE
,
&
gff_pipe_err
)
!=
G_IO_STATUS_NORMAL
)
if
(
server
->
gff_
std
err
&&
g_io_channel_shutdown
(
server
->
gff_
std
err
,
FALSE
,
&
gff_pipe_err
)
!=
G_IO_STATUS_NORMAL
)
{
zMapLogCritical
(
"Could not close error pipe
\"
%s
\"
"
,
server
->
script_path
)
;
...
...
@@ -815,8 +821,8 @@ static ZMapServerResponseType closeConnection(void *server_in)
else
{
/* this seems to be required to destroy the GIOChannel.... */
g_io_channel_unref
(
server
->
gff_er
ro
r
)
;
server
->
gff_er
ro
r
=
NULL
;
g_io_channel_unref
(
server
->
gff_
std
err
)
;
server
->
gff_
std
err
=
NULL
;
}
return
result
;
...
...
This diff is collapsed.
Click to expand it.
src/zmapServer/pipe/pipeServer_P.h
+
2
−
2
View file @
18c8f05c
...
...
@@ -28,7 +28,7 @@
*
* HISTORY:
* Created: Thu Nov 26 10:30:21 2009 (mh17)
* CVS info: $Id: pipeServer_P.h,v 1.
3
2009-12-0
4
1
6:01
:3
9
mh17 Exp $
* CVS info: $Id: pipeServer_P.h,v 1.
4
2009-12-0
7
1
0:48
:3
1
mh17 Exp $
*-------------------------------------------------------------------
*/
#ifndef PIPE_SERVER_P_H
...
...
@@ -51,7 +51,7 @@ typedef struct _PipeServerStruct
gchar
*
script_path
;
// where our configured script is, includign script-dir
gchar
*
query
;
// from query string
GIOChannel
*
gff_pipe
;
// the pipe we read the script's output from
GIOChannel
*
gff_err
or
;
// the pipe we read the script's error output from
GIOChannel
*
gff_
std
err
;
// the pipe we read the script's error output from
GPid
child_pid
;
gint
zmap_start
,
zmap_end
;
// display coordinates of interesting region
gint
wait
;
// delay before gettign data, mainly for testing
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment