Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 321063 - [tcf][agent] The script functionality of the C client doesn't work
Summary: [tcf][agent] The script functionality of the C client doesn't work
Status: RESOLVED FIXED
Alias: None
Product: TCF
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.4.0   Edit
Assignee: Project Inbox CLA
QA Contact: Martin Oberhuber CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-07-27 15:36 EDT by Michael Sills-Lavoie CLA
Modified: 2013-06-05 07:56 EDT (History)
2 users (show)

See Also:


Attachments
Script test example (32 bytes, text/plain)
2010-07-27 15:37 EDT, Michael Sills-Lavoie CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Sills-Lavoie CLA 2010-07-27 15:36:56 EDT
Build Identifier: rev 1079

Since revision 900, it's impossible to use the script functionality with the C client.

The client report the channel as closed even if it's not : Reply error 131077: Channel closed.

This is due to the addition of an if statement in protocol.c at line 429 (last revision): 

if (c->peer_service_list == NULL) {
    post_event(send_command_failed, rh);
}

This statement checks if the remote agent has any services. Since the "hello" message is not received at the time of sending the command, the client report the connection as closed. Removing this check resolve the problem.

Removing the check is probably not the best option. Adding a sleep after a connect command in the client is not either but I am not sure how you want to solve this.

Reproducible: Always

Steps to Reproduce:
1. Start an agent with at least one service that you will use to send a command.
2. Create a script file with a connect statement followed by any command (see attachment for an example).
3. Start the client with the script you just created : client -S test
4. The client report that the channel is closed.
Comment 1 Michael Sills-Lavoie CLA 2010-07-27 15:37:53 EDT
Created attachment 175347 [details]
Script test example
Comment 2 Eugene Tarassov CLA 2010-07-28 13:54:56 EDT
"connect" command handler in cmdline.c calls cmd_done() when a channel socket is connected, which is too early. I have changed the code to call cmd_done() when the channel itself (not just the socket) is connected.
Comment 3 Doug Schaefer CLA 2011-05-17 10:50:52 EDT
Moving bugs to new home for IP log.
Comment 4 Martin Oberhuber CLA 2013-06-05 06:28:40 EDT
Bulk change: Marking all bugs from the TM era (until June 2011) target 0.3