Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 60259 Details for
Bug 165944
FileTransferManager getFile/putFile methods hang.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
AC patch
ac.txt (text/plain), 6.97 KB, created by
Igor Alelekov
on 2007-03-05 08:06:31 EST
(
hide
)
Description:
AC patch
Filename:
MIME Type:
Creator:
Igor Alelekov
Created:
2007-03-05 08:06:31 EST
Size:
6.97 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.platform.agentcontroller >Index: src-native-new/src/shared/TPTPUtil/dime.c >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/shared/TPTPUtil/dime.c,v >retrieving revision 1.10 >diff -u -r1.10 dime.c >--- src-native-new/src/shared/TPTPUtil/dime.c 24 Jan 2006 01:40:23 -0000 1.10 >+++ src-native-new/src/shared/TPTPUtil/dime.c 5 Mar 2007 11:32:03 -0000 >@@ -14,6 +14,7 @@ > #include "tptp/TPTPCommon.h" > #include "tptp/TPTPTypes.h" > #include "tptp/TPTPUtils.h" >+#include "tptp/TPTPErrorCode.h" > #include "tptp/dime.h" > > #include "tptp/TPTPMessageHeader.h" >@@ -81,11 +82,18 @@ > > tptp_int32 construct_dime_file_transfer(DIME_HEADER_PTR_T *p, char *fileName, tptp_int32 dataSize) > { >+ return construct_dime_file_transfer_error(p, fileName, dataSize, TPTP_OK); >+} >+ >+tptp_int32 construct_dime_file_transfer_error(DIME_HEADER_PTR_T *p, char *fileName, tptp_int32 dataSize, int errCode) >+{ > tptp_int32 status; > tptp_int32 fileNameLength = strlen(fileName)+1; >+ tptp_int32 dime_len; > char *q; > >- *p = (DIME_HEADER_PTR_T) tptp_malloc(sizeof(DIME_HEADER_T)+ fileNameLength); >+ dime_len = sizeof(DIME_HEADER_T) + fileNameLength + 1; >+ *p = (DIME_HEADER_PTR_T) tptp_malloc(dime_len); > status = INIT_DIME_HEADER(*p); > /* (*p)->data_length = buffer_length; */ > >@@ -96,8 +104,10 @@ > (*p)->data_length = (tptp_uint32) dataSize; > /*(*p)->data = buffer; we don't add the buffer to avoid the copy */ > >+ (*p)->options_length = 1; >+ *(q + fileNameLength) = (char) errCode; > >- return sizeof(DIME_HEADER_T) + fileNameLength ; /* may have to add options + type */ >+ return dime_len; /* may have to add options + type */ > } > > >@@ -120,6 +130,10 @@ > return (construct_dime_file_transfer(p, buffer, dataSize)) ; > } > >+void free_dime (DIME_HEADER_PTR_T p) >+{ >+ tptp_free (p); >+} > > tptp_int32 is_valid_header(DIME_HEADER_PTR_T p, tptp_int32 amount_read) > { >Index: src-native-new/src/shared/TPTPUtil/TPTUtil.def >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/shared/TPTPUtil/TPTUtil.def,v >retrieving revision 1.26 >diff -u -r1.26 TPTUtil.def >--- src-native-new/src/shared/TPTPUtil/TPTUtil.def 21 Apr 2006 00:49:06 -0000 1.26 >+++ src-native-new/src/shared/TPTPUtil/TPTUtil.def 5 Mar 2007 11:32:02 -0000 >@@ -56,7 +56,9 @@ > XMutexDelete > printCurrentSysError > construct_dime_file_transfer >+ construct_dime_file_transfer_error > construct_dime_console >+ free_dime > init_dime_header > get_dime_id > get_dime_length >Index: src-native-new/src/agents/FileTransferAgent/FileTransferAgent.cpp >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/src/agents/FileTransferAgent/FileTransferAgent.cpp,v >retrieving revision 1.22 >diff -u -r1.22 FileTransferAgent.cpp >--- src-native-new/src/agents/FileTransferAgent/FileTransferAgent.cpp 26 Oct 2006 22:28:51 -0000 1.22 >+++ src-native-new/src/agents/FileTransferAgent/FileTransferAgent.cpp 5 Mar 2007 11:32:02 -0000 >@@ -204,10 +204,25 @@ > > MAKE_NBO_DIME_HEADER((char *) dp); > rc = sendData(destinationID, buffer, bufferLength, dp, dimeLength); >+ FREE_DIME (dp); > > return 0; > } > >+void FileTransferAgent::sendError(tptp_int32 destinationID, char *fileName, int errCode) >+{ >+ DIME_HEADER_PTR_T dp; >+ tptp_int32 dimeLength; >+ >+ dimeLength = MAKE_DIME_FILE_TRANSFER_ERROR(&dp, fileName, 0, errCode); >+ DIME_START(dp); >+ DIME_END(dp); >+ >+ MAKE_NBO_DIME_HEADER((char *) dp); >+ sendData(destinationID, NULL, 0, dp, dimeLength); >+ FREE_DIME (dp); >+} >+ > tptp_int32 FileTransferAgent::openAndSendFile(tptp_int32 clientId, char *localFile, char *remoteFile) > { > char buffer[BLOCK_SIZE+1]; >@@ -222,6 +237,7 @@ > fp = fopen(remoteFile, "rb"); > if (fp == NULL) { > TPTP_LOG_ERROR_MSG(this, "FileTransferAgent getFile remote NULL"); >+ sendError(clientId, localFile, FILE_NOT_FOUND); > return ret; > } > >@@ -251,7 +267,7 @@ > > recType = DIME_MESSAGE_END; > } >- } >+ } > ret = this->sendFileData(clientId, buffer, n, recType, localFile); > //TPTP_LOG_DEBUG_MSG1(this, "Send %d bytes of data", n); > i++; >Index: src-native-new/include/tptp/dime.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/include/tptp/dime.h,v >retrieving revision 1.10 >diff -u -r1.10 dime.h >--- src-native-new/include/tptp/dime.h 24 Jan 2006 01:51:39 -0000 1.10 >+++ src-native-new/include/tptp/dime.h 5 Mar 2007 11:32:02 -0000 >@@ -52,8 +52,10 @@ > > tptp_int32 init_dime_header(DIME_HEADER_PTR_T p); > tptp_int32 construct_dime_file_transfer(DIME_HEADER_PTR_T *p, char *fileName, tptp_int32 length); >+tptp_int32 construct_dime_file_transfer_error(DIME_HEADER_PTR_T *p, char *fileName, tptp_int32 length, int errCode); > tptp_int32 construct_dime_console(DIME_HEADER_PTR_T *p, PID processId, tptp_int32 consoleType, tptp_int32 dataSize) ; > char *get_dime_id(DIME_HEADER_PTR_T p); >+void free_dime(DIME_HEADER_PTR_T p); > > PID get_dime_process_id(DIME_HEADER_PTR_T p); > tptp_int32 get_dime_console_type(DIME_HEADER_PTR_T p); >@@ -66,7 +68,9 @@ > #define MAKE_NBO_DIME_HEADER(b) make_dime_header(b) > #define MAKE_DIME_HEADER(b) make_dime_header(b) > #define MAKE_DIME_FILE_TRANSFER(xp, b, c) construct_dime_file_transfer(xp, b, c) >+#define MAKE_DIME_FILE_TRANSFER_ERROR(xp, b, c, e) construct_dime_file_transfer_error(xp, b, c, e) > #define MAKE_DIME_CONSOLE(xp, id, ct, ds) construct_dime_console(xp, id, ct, ds) >+#define FREE_DIME(x) free_dime(x) > #define DIME_START(xp) xp->mb = 0x1; > #define DIME_END(xp) xp->me = 0x1; > >Index: src-native-new/include/tptp/agents/FileTransferAgent.h >=================================================================== >RCS file: /cvsroot/tptp/platform/org.eclipse.tptp.platform.agentcontroller/src-native-new/include/tptp/agents/FileTransferAgent.h,v >retrieving revision 1.7 >diff -u -r1.7 FileTransferAgent.h >--- src-native-new/include/tptp/agents/FileTransferAgent.h 30 Sep 2005 01:16:42 -0000 1.7 >+++ src-native-new/include/tptp/agents/FileTransferAgent.h 5 Mar 2007 11:32:02 -0000 >@@ -19,7 +19,9 @@ > #include "tptp/TPTPTypes.h" > #include "tptp/TPTPUtils.h" > >- >+#define FILE_TRANSFER_ERROR 1 >+#define FILE_NOT_FOUND 2 >+#define FILE_READ_ERROR 3 > > using namespace std; > >@@ -41,6 +43,7 @@ > tptp_int32 MapCommandNameToID(char* cmdName); > tptp_int32 MapInterfaceNameToID(char* interfaceName); > tptp_int32 sendFileData(tptp_int32 destinationID, char buffer[], tptp_int32 bufferLength, tptp_int32 recType, char *fileName); >+ void sendError(tptp_int32 destinationID, char *fileName, int errCode); > tptp_list_t fileOpList; > Lock_t fileOpListLock; > tptp_int32 findFileRecordByName(const char *fileName, tptp_file_t *fileRec);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 165944
: 60259 |
60260