Ticket #349 revisited: Crash when sending PUBLISH when network is unreachable

git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@1432 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip/src/pjsip-simple/publishc.c b/pjsip/src/pjsip-simple/publishc.c
index 3f11ad1..042a16a 100644
--- a/pjsip/src/pjsip-simple/publishc.c
+++ b/pjsip/src/pjsip-simple/publishc.c
@@ -439,11 +439,15 @@
 	status = pjsip_publishc_send(pubc, tdata);
     } 
     
-    if (status != PJ_SUCCESS) {
-	char errmsg[PJ_ERR_MSG_SIZE];
-	pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg));
-	call_callback(pubc, status, 400, &reason, NULL, -1);
-    }
+    // Callback should have been called.
+    // Calling it here will crash the system since pubc might have been
+    // destroyed
+    //
+    //if (status != PJ_SUCCESS) {
+    //	char errmsg[PJ_ERR_MSG_SIZE];
+    //	pj_str_t reason = pj_strerror(status, errmsg, sizeof(errmsg));
+    //	call_callback(pubc, status, 400, &reason, NULL, -1);
+    //}
 }
 
 static void tsx_callback(void *token, pjsip_event *event)
@@ -479,11 +483,15 @@
 	    status = pjsip_publishc_send(pubc, tdata);
 	} 
 	
-	if (status != PJ_SUCCESS) {
-	    call_callback(pubc, status, tsx->status_code, 
-			  &rdata->msg_info.msg->line.status.reason,
-			  rdata, -1);
-	}
+	// Callback should have been called.
+	// Calling it here will crash the system since pubc might have been
+	// destroyed
+	//
+	//if (status != PJ_SUCCESS) {
+	//    call_callback(pubc, status, tsx->status_code, 
+	//		  &rdata->msg_info.msg->line.status.reason,
+	//		  rdata, -1);
+	//}
 
 	return;